  import {
      msg
  } from '../common/layer';
const submit = (url,data) => {
    $('#submitBtn').attr('disabled', 'disabled');
    $.ajax({
        url: url,
        type: 'post',
        dataType: 'json',
        data: data,
        success: function(res) {
            if (res.rel == 1) {
                msg(res.msg, function() {
                    layer.closeAll();
                    let options=$('#table').bootstrapTable('getOptions');
                    $('#table').bootstrapTable('destroy');
                    $('#table').bootstrapTable(options);
                });
            } else {
                msg(res.msg);
                $('#submitBtn').removeAttr('disabled');
            }
        }
    });
};

export {submit}